<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 封装函数 -->
    <!-- 调用函数call function -->
    <input type="button" value="调用函数"onclick="fn01()">
    
    <!-- 闰年 -->
 <script>
    function fn01(){
        var year=2000;
        if(isRunYear(year)){
            console.log(year+"是闰年");
        }
        else{
            console.log(year+"是平年");
    }
    // var count=shwDayCount(2004,5,3);
    // console.log("count",count);
  console.log( toChineseWeek(5));


}
function isRunYear(year) {
    // return ((year%4==0&&year%100!=0)||(year%400==0))
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
        return true;
    }
    return false;
}
function toChineseWeek(num) {
    // if (num < 0 && num > 7) {
    //     return false;
    // }
    switch (num) {
        case 0: return "星期天"
        case 1: return "星期一"
        case 2: return "星期二"
        case 3: return "星期三"
        case 4: return "星期四"
        case 5: return "星期五"
        case 6: return "星期六"
        default: return false;
    }

}
 </script>
</body>
</html>